xen.git
17 years agoioemu: fix disk format security vulnerability
Keir Fraser [Mon, 12 May 2008 09:09:12 +0000 (10:09 +0100)]
ioemu: fix disk format security vulnerability

* make the xenstore reader in qemu-dm's startup determine which
  of qemu's block drivers to use according to the xenstore
  backend `type' field.  This `type' field typically comes from
  the front of the drive mapping string in ioemu.  The
  supported cases are:
    xm config file string      `type'  image format    qemu driver
     phy:[/dev/]<device>        phy     raw image       bdrv_raw
     file:<filename>            file    raw image       bdrv_raw
     tap:aio:<filename>         tap     raw image       bdrv_raw
     tap:qcow:<image>           tap     not raw         autoprobe
     tap:<cow-fmt>:<image>      tap     named format    bdrv_<cow-fmt>
  It is still necessary to autoprobe when the image is specified as
  `tap:qcow:<image>', because qemu distinguishes `qcow' and `qcow2'
  whereas blktap doesn't; `qcow' in xenstore typically means what
  qemu calls qcow2.  This is OK because qemu can safely distinguish
  the different cow formats provided we know it's not a raw image.

* Make the format autoprobing machinery never return `raw'.  This has
  two purposes: firstly, it arranges that the `tap:qcow:...' case
  above can be handled without accidentally falling back to raw
  format.  Secondly it prevents accidents in case the code changes in
  future: autoprobing will now always fail on supposed cow files which
  actually contain junk, rather than giving the guest access to the
  underlying file.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
17 years agox86 hvm: Support MSI-X for HVM domains.
Keir Fraser [Mon, 12 May 2008 09:07:26 +0000 (10:07 +0100)]
x86 hvm: Support MSI-X for HVM domains.
Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
17 years agox86 hvm: Clean MSI related data when destroy domain.
Keir Fraser [Mon, 12 May 2008 09:06:40 +0000 (10:06 +0100)]
x86 hvm: Clean MSI related data when destroy domain.
Signed-off-by: Shan Haitao <Haitao.shan@intel.com>
17 years agox86: Fix fatal page fault when vram dirty logic handles MMIO of passthrough devices.
Keir Fraser [Mon, 12 May 2008 09:01:01 +0000 (10:01 +0100)]
x86: Fix fatal page fault when vram dirty logic handles MMIO of passthrough devices.

Signed-off-by: Qing He <qing.he@intel.com>
17 years agoClean up shadow code after the removal of non-PAE 32-bit builds
Keir Fraser [Thu, 8 May 2008 15:58:33 +0000 (16:58 +0100)]
Clean up shadow code after the removal of non-PAE 32-bit builds

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agoxend: Fix and improve error handling for failed suspend/migrate
Keir Fraser [Thu, 8 May 2008 13:33:31 +0000 (14:33 +0100)]
xend: Fix and improve error handling for failed suspend/migrate

This has been broken since cset 16964:5d84464dc1fc
Also deal better with very early errors (close sender side socket)

Signed-off-by: Steven Hand <steven.hand@cl.cam.ac.uk>
17 years agoi386: Remove non-PAE hypervisor build target.
Keir Fraser [Thu, 8 May 2008 13:32:11 +0000 (14:32 +0100)]
i386: Remove non-PAE hypervisor build target.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoRemove defunct powerpc port.
Keir Fraser [Thu, 8 May 2008 12:40:40 +0000 (13:40 +0100)]
Remove defunct powerpc port.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoshadow: drop guest VRAM write access after some idleness
Keir Fraser [Thu, 8 May 2008 12:15:45 +0000 (13:15 +0100)]
shadow: drop guest VRAM write access after some idleness

If the video RAM has been kept clean for at least 2 seconds, we can
afford taking the time to drop guest write access, which allows us to
save the dirty bit scanning entirely until we get a guest page handle.

From: Samuel Thibault <samuel.thibault@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agominios: fix and enforce block_domain atomicity
Keir Fraser [Thu, 8 May 2008 12:14:27 +0000 (13:14 +0100)]
minios: fix and enforce block_domain atomicity

To ensure that the timer event is not lost, block_domain requires that
event delivery is disabled.  SCHEDOP_block re-enables them, so for
coherency (and fixing a bug actually), we should re-disable them
after. Also, make sure that the caller disabled them.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agominios: in non-x86 case, use wmb to enforce ordering between
Keir Fraser [Thu, 8 May 2008 10:55:13 +0000 (11:55 +0100)]
minios: in non-x86 case, use wmb to enforce ordering between
evtchn_upcall_pending and evtchn_pending_sel stores.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agominios: clear the event before calling the handler since (especially
Keir Fraser [Thu, 8 May 2008 10:53:39 +0000 (11:53 +0100)]
minios: clear the event before calling the handler since (especially
in the SMP case) the handler may make another domain send an event
again, and that must not be lost.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agominios: fix port selection shifts
Keir Fraser [Thu, 8 May 2008 10:27:22 +0000 (11:27 +0100)]
minios: fix port selection shifts

Event selectors span unsigned longs, whose size is not always 32 bits.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoXend: Fix handling of vnc params.
Keir Fraser [Thu, 8 May 2008 10:20:04 +0000 (11:20 +0100)]
Xend: Fix handling of vnc params.

Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agoFix the boot of ia32pae Windows xp guest (up acpi)
Keir Fraser [Thu, 8 May 2008 10:18:34 +0000 (11:18 +0100)]
Fix the boot of ia32pae Windows xp guest (up acpi)
  - X86_FEATURE_APIC should be in edx register.

Signed-off-by: Xu Dongxiao <dongxiao.xu@intel.com>
17 years agoxend: Improve "cpus" parameter to be able to define CPU affinities for each VCPU
Keir Fraser [Thu, 8 May 2008 10:15:58 +0000 (11:15 +0100)]
xend: Improve "cpus" parameter to be able to define CPU affinities for each VCPU

If we define the form of list of string to "cpus" parameter,
different CPU affinities are set for each VCPU as follows.

 # grep cpus /etc/xen/vm1
 cpus = ["2", "3"]
 vcpus = 2
 # xm create vm1
 Using config file "/etc/xen/vm1".
 Started domain vm1
 # xm vcpu-list vm1
 Name                                ID  VCPU   CPU State   Time(s)
 CPU Affinity
 vm1                                  1     0     2   r--       3.5 2
 vm1                                  1     1     3   -b-       3.2 3

If we define the form of string to "cpus" parameter as before,
a same CPU affinity is set for each VCPU as follows.

 # grep cpus /etc/xen/vm2
 cpus = "2,3"
 vcpus = 2
 # xm create vm2
 Using config file "/etc/xen/vm2".
 Started domain vm2
 # xm vcpu-list vm2
 Name                                ID  VCPU   CPU State   Time(s)
 CPU Affinity
 vm2                                  2     0     3   -b-       3.0
 2-3
 vm2                                  2     1     2   r--       2.6
 2-3

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoFixed typos in xmexamples.
Keir Fraser [Thu, 8 May 2008 10:13:51 +0000 (11:13 +0100)]
Fixed typos in xmexamples.

Signed-off-by: Hiroya INAKOSHI <inakoshi.hiroya@jp.fujitsu.com>
17 years agoXM/XenAPI: Enable Console other_config parameters to be passed through Xen API.
Keir Fraser [Wed, 7 May 2008 13:16:48 +0000 (14:16 +0100)]
XM/XenAPI: Enable Console other_config parameters to be passed through Xen API.
Signed-off-by: Yosuke Iwamatsu <y-iwamatsu@ab.jp.nec.com>
17 years agox86 pci passthrough: Make printk messages more exact.
Keir Fraser [Wed, 7 May 2008 08:45:55 +0000 (09:45 +0100)]
x86 pci passthrough: Make printk messages more exact.
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoVt-d doc: Update modification time.
Keir Fraser [Wed, 7 May 2008 08:30:34 +0000 (09:30 +0100)]
Vt-d doc: Update modification time.
Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agoUpdate for vtd.txt: add VT-d hotplug description, remove MSI
Keir Fraser [Wed, 7 May 2008 08:23:29 +0000 (09:23 +0100)]
Update for vtd.txt: add VT-d hotplug description, remove MSI
limitation note because Xen has supported MSI, and add link of VT-d
howto on xen wiki for more information about VT-d enabled systems.

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Edwin Zhai <edwin.zhai@intel.com>
17 years agoVT-d: Remove unused function dma_pte_free_pagetable().
Keir Fraser [Wed, 7 May 2008 08:22:05 +0000 (09:22 +0100)]
VT-d: Remove unused function dma_pte_free_pagetable().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoVT-d: Fix free VT-d page table issue
Keir Fraser [Wed, 7 May 2008 08:19:40 +0000 (09:19 +0100)]
VT-d: Fix free VT-d page table issue

This patch frees VT-d page tables from pgd, rather than free them
according to a guest address range.

This fixes [Bug 1244] Poweroff/Destroying HVM guest causes HV
crash. http://bugzilla.xensource.com/bugzilla/show_bug.cgi?id=1244.

Signed-off-by: Weidong Han <weidong.han@intel.com>
17 years agomsix: Further fixes to Python arithmetic.
Keir Fraser [Wed, 7 May 2008 08:17:52 +0000 (09:17 +0100)]
msix: Further fixes to Python arithmetic.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 shadow: Fix typo in a code comment.
Keir Fraser [Wed, 7 May 2008 08:15:49 +0000 (09:15 +0100)]
x86 shadow: Fix typo in a code comment.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agominios: drop volatile qualifier from some status variables
Keir Fraser [Tue, 6 May 2008 15:35:44 +0000 (16:35 +0100)]
minios: drop volatile qualifier from some status variables
since we already use memory barriers as approriate to prevent
concurrent access with event handlers.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agominios: let events get mixed
Keir Fraser [Tue, 6 May 2008 15:29:01 +0000 (16:29 +0100)]
minios: let events get mixed
since events do not need to be counted

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 hvm: Warn only once per time source when the periodic tiemout is
Keir Fraser [Tue, 6 May 2008 15:20:54 +0000 (16:20 +0100)]
x86 hvm: Warn only once per time source when the periodic tiemout is
set 'too small'.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 hvm: Support interrupt delivery for PIT channel 0 when in modes 3 and 4.
Keir Fraser [Tue, 6 May 2008 15:20:24 +0000 (16:20 +0100)]
x86 hvm: Support interrupt delivery for PIT channel 0 when in modes 3 and 4.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: Only import OpenSSL package when it is required.
Keir Fraser [Tue, 6 May 2008 14:31:15 +0000 (15:31 +0100)]
xend: Only import OpenSSL package when it is required.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agominios: fix thread safety of xenbus watches by requiring callers to
Keir Fraser [Tue, 6 May 2008 12:34:52 +0000 (13:34 +0100)]
minios: fix thread safety of xenbus watches by requiring callers to
provide their own queue of events, because else we can not dispatch to
watchers running in parallel.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoSVM: clean up __get_instruction_length_from_list()
Keir Fraser [Tue, 6 May 2008 12:32:18 +0000 (13:32 +0100)]
SVM: clean up __get_instruction_length_from_list()

Remove unused arguments, fix its behaviour near page boundaries,
inject appropriate pagefaults, and inject #GP if the instruction is
not decodable or %eip is not pointing to valid RAM.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86 hvm: Simplify and consolidate logic for HLT emulation.
Keir Fraser [Tue, 6 May 2008 10:05:00 +0000 (11:05 +0100)]
x86 hvm: Simplify and consolidate logic for HLT emulation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, Intel: Make only EST feature visible to dom0 to enable Cx-state
Keir Fraser [Tue, 6 May 2008 09:25:34 +0000 (10:25 +0100)]
x86, Intel: Make only EST feature visible to dom0 to enable Cx-state
logic. There should be no need to make MWAIT visible.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, hvm: stdvga cache always on
Keir Fraser [Tue, 6 May 2008 09:19:10 +0000 (10:19 +0100)]
x86, hvm: stdvga cache always on

currently the hypervisor vga cache (stdvga.c) enables itself only in
graphical mode and in the a0000h-affffh range. However there is no
reason for this: it already allocates enought memory to map the whole
vram. I am attaching a patch that implements the bank switching
mechanism in stdvga.c, allowing the cache to be always enabled when
the emulated graphic card is in VGA mode.

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxend: Refactor security.on() call
Keir Fraser [Tue, 6 May 2008 09:05:52 +0000 (10:05 +0100)]
xend: Refactor security.on() call

I am refactoring the security.on() call to return the actual type of
the security module that is found to be enabled rather than just
returning True or False.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoFix the address calculation of acpi enable reg according to ACPI spec.
Keir Fraser [Mon, 5 May 2008 09:16:58 +0000 (10:16 +0100)]
Fix the address calculation of acpi enable reg according to ACPI spec.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoEnable Px/Cx related CPUID/MSR bits for dom0 to get correct Px/Cx info.
Keir Fraser [Mon, 5 May 2008 09:16:06 +0000 (10:16 +0100)]
Enable Px/Cx related CPUID/MSR bits for dom0 to get correct Px/Cx info.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoshadow: Fix dirty vram tracking typo.
Keir Fraser [Mon, 5 May 2008 09:13:17 +0000 (10:13 +0100)]
shadow: Fix dirty vram tracking typo.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoCalculation of MSI-X table size needs to be masked.
Keir Fraser [Mon, 5 May 2008 09:12:44 +0000 (10:12 +0100)]
Calculation of MSI-X table size needs to be masked.

Signed-off-by: Espen Skoglund <espen.skoglund@netronome.com>
17 years agoi386: Fix 32-bit x86 build.
Keir Fraser [Sun, 4 May 2008 07:32:00 +0000 (08:32 +0100)]
i386: Fix 32-bit x86 build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoAdd missing ChangeLog entries
Keir Fraser [Fri, 2 May 2008 14:10:20 +0000 (15:10 +0100)]
Add missing ChangeLog entries

A couple of recent changes need ChangeLog entries.

Signed-off-by: John Levon <john.levon@sun.com>
17 years agoshadow: track video RAM dirty bits
Keir Fraser [Fri, 2 May 2008 14:08:27 +0000 (15:08 +0100)]
shadow: track video RAM dirty bits

This adds a new HVM op that enables tracking dirty bits of a range of
video RAM.  The idea is to optimize just for the most common case
(only one guest mapping, with sometimes some temporary other
mappings), which permits to keep the overhead on shadow as low as
possible.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agominios: end watch of FS backend state value
Keir Fraser [Fri, 2 May 2008 13:35:27 +0000 (14:35 +0100)]
minios: end watch of FS backend state value

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: move VNC-specific switchbpp member to VncState
Keir Fraser [Fri, 2 May 2008 12:48:36 +0000 (13:48 +0100)]
ioemu: move VNC-specific switchbpp member to VncState

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: always disable shared buffer in text mode
Keir Fraser [Fri, 2 May 2008 12:48:10 +0000 (13:48 +0100)]
ioemu: always disable shared buffer in text mode
by not calling get_bpp() (which only makes sense in graphical mode)
and always use 0 instead.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years agoioemu: pump SDL events on resize
Keir Fraser [Fri, 2 May 2008 12:47:46 +0000 (13:47 +0100)]
ioemu: pump SDL events on resize

When sdl_resize resizes the SDL window, some window manager send back
a ConfigureNotify event, which triggers a SDL_VIDEORESIZE event. That
event, however, is seen only much later, on the next VGA refresh
round. If the guest quickly switches to another resolution in between,
the SDL_VIDEORESIZE event makes us erroneously rescale that new
resolution into the old one.

This patch makes us pump that window manager event, so that no
SDL_VIDEORESIZE event is generated.

Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
17 years ago[libfsimage/zfs] compilation fix ZFS libfsimage support.
Keir Fraser [Fri, 2 May 2008 12:47:01 +0000 (13:47 +0100)]
[libfsimage/zfs] compilation fix ZFS libfsimage support.

Depending on environments, zfs libfsimage support doesn't compile.
This patch fixes it.

ia64-linux-gnu-gcc  -DPIC -O2 -fomit-frame-pointer
-fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes
-Wno-unused-value -Wdeclaration-after-statement
-I/usr/ia64-linux-gnu/
sys-root/usr/include -D__XEN_TOOLS__  -D_LARGEFILE_SOURCE
-D_LARGEFILE64_SOURCE  -I../../../tools/libfsimage/common/ -Werror
-Wp,-MD,.zfs_lzjb.opic.d -fPIC -c -o zfs_lzjb.opic zfs_
lzjb.c
In file included from fsys_zfs.h:41,
                 from zfs_lzjb.c:25:
zfs-include/zfs_acl.h:29: error: redefinition of typedef uid_t
/usr/ia64-linux-gnu/sys-root/usr/include/sys/types.h:82: error:
previous declaration of uid_t was here

This depends on how __uid_t is defined in the system header.
No file under the zfs directory uses uid_t so that just removing
the definition in the zfs_acl.h looks reasonable.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
17 years agolibxc foreign address translation bug
Keir Fraser [Fri, 2 May 2008 12:46:16 +0000 (13:46 +0100)]
libxc foreign address translation bug

In the xc_translate_foreign_address function from libxc, there is a
check on the page directory entry to see if the page is 4K or 4M.
However, the check is looking at bit 3, when it should be looking at
bit 7.  This patch fixes the problem.

Signed-off-by: Bryan D. Payne <bryan@thepaynes.cc>
17 years agoAdd ZFS libfsimage support patch
Keir Fraser [Thu, 1 May 2008 15:38:56 +0000 (16:38 +0100)]
Add ZFS libfsimage support patch

Add support to pygrub and libfsimage to boot ZFS root filesystems.
Boot argument of zfs-bootfs is set to describe ZFS root pool and
boot filesystem object number.  Boot argument bootpath is set to
describe the virtual device root mirror components.

Signed-off-by: Susan Kamm-Worrell <susan.kamm-worrell@sun.com>
17 years agoFix lint in headers that are pulled into the Solaris tree.
Keir Fraser [Thu, 1 May 2008 15:37:46 +0000 (16:37 +0100)]
Fix lint in headers that are pulled into the Solaris tree.

Signed-off-by: Ryan Scott <ryan.scott@sun.com>
17 years agoFix xenstore-client.c compile
Keir Fraser [Thu, 1 May 2008 15:37:28 +0000 (16:37 +0100)]
Fix xenstore-client.c compile

errx() is not necessarily defined as a never-returns function. Fix
lookup_mode() to account for this.

Signed-off-by: John Levon <john.levon@sun.com>
17 years agoAllow .config to override the "cc_compile_by" and "cc_compile_domain" settings.
Keir Fraser [Thu, 1 May 2008 15:36:58 +0000 (16:36 +0100)]
Allow .config to override the "cc_compile_by" and "cc_compile_domain" settings.

Signed-off-by: David Edmondson <dme@sun.com>
17 years agoRemove unimplemented xm migrate --resource option.
Keir Fraser [Thu, 1 May 2008 15:35:49 +0000 (16:35 +0100)]
Remove unimplemented xm migrate --resource option.

Signed-off-by: Gary Pennington <gary.pennington@sun.com>
17 years agoAccept decimal block device IDs
Keir Fraser [Thu, 1 May 2008 15:35:28 +0000 (16:35 +0100)]
Accept decimal block device IDs

Solaris uses a simple indexing scheme for block devices. Parts of xend
translate them as hexadecimal (such as block-attach), and decimal, or
unconverted, elsewhere (such as block-detach). Harmonise these
interfaces by allowing decimal specifications.

Also allow Solaris-style block device names.

Signed-off-by: John Levon <john.levon@sun.com>
17 years agox86 hvm cpuid: fix some problem with the hvm's cpuid configuration.
Keir Fraser [Thu, 1 May 2008 15:08:36 +0000 (16:08 +0100)]
x86 hvm cpuid: fix some problem with the hvm's cpuid configuration.

  - When we overwrite a cpuid's input, apply the default policy
    for the other registers.
  - For the python binding, get unsigned long instead long.
  - Fix the multiple inputs cpuid's configuration parsing.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
17 years agoIntel vpid: Invalidate VPID mapping on INVLPG.
Keir Fraser [Thu, 1 May 2008 15:07:56 +0000 (16:07 +0100)]
Intel vpid: Invalidate VPID mapping on INVLPG.
Signed-off-by: Gianluca Guida <gianluca.guida@eu.citrix.com>
17 years agoi386: Fix the build.
Keir Fraser [Thu, 1 May 2008 14:44:35 +0000 (15:44 +0100)]
i386: Fix the build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoUpdate README to reference next major Xen release (3.3).
Keir Fraser [Thu, 1 May 2008 13:04:12 +0000 (14:04 +0100)]
Update README to reference next major Xen release (3.3).
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agodocs: Do not reference stale external websites.
Keir Fraser [Thu, 1 May 2008 12:47:08 +0000 (13:47 +0100)]
docs: Do not reference stale external websites.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Fix FADT parsing for PM event blocks.
Keir Fraser [Thu, 1 May 2008 12:16:32 +0000 (13:16 +0100)]
x86: Fix FADT parsing for PM event blocks.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86: Support x2APIC mode.
Keir Fraser [Thu, 1 May 2008 10:34:56 +0000 (11:34 +0100)]
x86: Support x2APIC mode.
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agox86: Make apicid 32 bits in preparation for x2APIC support.
Keir Fraser [Thu, 1 May 2008 10:30:42 +0000 (11:30 +0100)]
x86: Make apicid 32 bits in preparation for x2APIC support.

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
17 years agox86: Add TSC stop support for Deep C state
Keir Fraser [Thu, 1 May 2008 09:50:09 +0000 (10:50 +0100)]
x86: Add TSC stop support for Deep C state

TSC may stop at deep C state (C3/C4...) entry/exit. this patch add the
logic that save and restore TSC during deep C state entry/exit, by
using platform timer (PIT/HPET)

Signed-off-by: Yu Ke <ke.yu@intel.com>
Signed-off-by: Tian Kevin <kevin.tian@intel.com>
Signed-off-by: Wei Gang<gang.wei@intel.com>
17 years agoi386: Fix build.
Keir Fraser [Thu, 1 May 2008 09:49:38 +0000 (10:49 +0100)]
i386: Fix build.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoAdd acpi C3 support for x86.
Keir Fraser [Thu, 1 May 2008 09:46:59 +0000 (10:46 +0100)]
Add acpi C3 support for x86.

C3 & deep C state will need to do ARB_DIS or cache flush. ARB_DIS
should be done within the last cpu which is ready for C3. Bus master
activities are checked and recorded for C state promotion/demotion
judgement.

C3 is disabled by default, till TSC/APIC stop issues resolved.
Adding cmdline option "max_cstate=3" can enable C3.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoPort acpi bit register support from Linux.
Keir Fraser [Thu, 1 May 2008 09:41:51 +0000 (10:41 +0100)]
Port acpi bit register support from Linux.

Bit register read/write is required by deep C code.
Remove dependendy on acpi_sinfo.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoAdd option "xen_processor_pm" in xen to enable dom0 external Cx control.
Keir Fraser [Thu, 1 May 2008 09:40:58 +0000 (10:40 +0100)]
Add option "xen_processor_pm" in xen to enable dom0 external Cx control.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoAdd basic acpi C-states based cpu idle power mgmt in xen for x86.
Keir Fraser [Thu, 1 May 2008 09:40:01 +0000 (10:40 +0100)]
Add basic acpi C-states based cpu idle power mgmt in xen for x86.

It includes:
 1. hypercall definition for passing ACPI info.
 2. C1/C2 support.
 3. Mwait support, as well as legacy ioport.
 4. Ladder policy from Linux kernel.

A lot of code & ideas came from Linux.

Signed-off-by: Wei Gang <gang.wei@intel.com>
17 years agoMSI 5/6: add MSI support to passthrough HVM domain
Keir Fraser [Thu, 1 May 2008 09:33:03 +0000 (10:33 +0100)]
MSI 5/6: add MSI support to passthrough HVM domain

Currently it only inercept access to MSI config space, no MSI-x support.

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
17 years agoMSI 4/6: remove io_mem permission for MSI-X, since MSI-X
Keir Fraser [Thu, 1 May 2008 09:32:10 +0000 (10:32 +0100)]
MSI 4/6: remove io_mem permission for MSI-X, since MSI-X
facilities are allocted through and located in PCI BAR.

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
17 years agoMSI 3/6: add msi support to xen
Keir Fraser [Thu, 1 May 2008 09:31:29 +0000 (10:31 +0100)]
MSI 3/6: add msi support to xen

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
17 years agoMSI 2/6: change the pirq to be per-domain
Keir Fraser [Thu, 1 May 2008 09:30:22 +0000 (10:30 +0100)]
MSI 2/6: change the pirq to be per-domain

Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
Signed-off-by: Shan Haitao <haitao.shan@intel.com>
17 years agoMSI 1/6: Move PCI functions and headers to a common location.
Keir Fraser [Thu, 1 May 2008 09:26:58 +0000 (10:26 +0100)]
MSI 1/6: Move PCI functions and headers to a common location.

Signed-off-by: Shan Haitao <haitao.shan@intel.com>
Signed-off-by: Jiang Yunhong <yunhong.jiang@intel.com>
17 years agoxemnstored: Fix xenstored abort when connection dropped.
Keir Fraser [Thu, 1 May 2008 09:00:00 +0000 (10:00 +0100)]
xemnstored: Fix xenstored abort when connection dropped.

If a connection is dropped with pending input and output data then the
connection will be dereferenced by both handle_input and handle_output
resulting in a double free when the main loop dereferences the
connection.

Fix this issue by taking/releasing a reference over the calls to
handle_input and handle_output separately and checking the result of
talloc_free to see if the connection went away.

Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
17 years ago[Xend/ACM] Provide explicit initialization function for bootloader class
Keir Fraser [Thu, 1 May 2008 08:55:45 +0000 (09:55 +0100)]
[Xend/ACM] Provide explicit initialization function for bootloader class

This patch refactors the initialization code for the bootloader class
and puts it into an explicit initialization function that is called
from another class.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years ago[Xend/ACM] Embed the policy schema in the python file
Keir Fraser [Thu, 1 May 2008 08:55:06 +0000 (09:55 +0100)]
[Xend/ACM] Embed the policy schema in the python file

This patch embeds the ACM policy's schema in the python file where the
schema is being accessed for verifying the policy XML. This way also
programs that cannot access a protected directory where the schema may
be located in can use this class.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
17 years agoVT-d: Separate VT-d page table from P2M table
Keir Fraser [Thu, 1 May 2008 08:53:26 +0000 (09:53 +0100)]
VT-d: Separate VT-d page table from P2M table

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
17 years agoFix xend config typos
Keir Fraser [Thu, 1 May 2008 08:50:58 +0000 (09:50 +0100)]
Fix xend config typos

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
17 years agoAdd SSL/TLS support to relocation
Keir Fraser [Thu, 1 May 2008 08:50:16 +0000 (09:50 +0100)]
Add SSL/TLS support to relocation

 * SSL/TLS support is disabled by default, as other server did.

 * If "xend-relocation-server-ssl-key-file" and
   "xend-relocation-server-ssl-cert-file" exist, SSL/TLS is enabled
   automatically.

 * "xend-relocation-tls" is used by relocation client only.

Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
17 years agox86 time: Read platform time before locally-extrapolated time during
Keir Fraser [Thu, 1 May 2008 08:45:44 +0000 (09:45 +0100)]
x86 time: Read platform time before locally-extrapolated time during
calibration and frequency changes. This places the variable delay
(acquiring the platform_timer_lock) safely as the very first thing we
do, avoiding a variable delay /between/ computing the two timestamps.

Problem diagnosed by Dave Winchell <dwinchell@virtualiron.com>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoChangeLog: Document DOMCTL_set_cpuid
Keir Fraser [Fri, 25 Apr 2008 12:46:27 +0000 (13:46 +0100)]
ChangeLog: Document DOMCTL_set_cpuid
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agox86, hvm: Guest CPUID configuration.
Keir Fraser [Fri, 25 Apr 2008 12:44:45 +0000 (13:44 +0100)]
x86, hvm: Guest CPUID configuration.

CPUID's replies are now pre-calculated in libxc and given to the
hypervisor via a new domctl.

There are two parts to this feature:
   - We can overwrite cpuid's replies.
   - We can check that a vm is compatible with a host's processor.

Signed-off-by: Jean Guyader <jean.guyader@eu.citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoxm: Add a new option to xm dump-core
Keir Fraser [Fri, 25 Apr 2008 12:40:39 +0000 (13:40 +0100)]
xm: Add a new option to xm dump-core

The option is -R|--reset.  A guest domain is reset after saving
a core dump of the guest domain when specified the option.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoxm: Fix cmdHelp() for xm reset
Keir Fraser [Fri, 25 Apr 2008 12:40:05 +0000 (13:40 +0100)]
xm: Fix cmdHelp() for xm reset

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
17 years agoIntel VPID: Do not crash if INVVPID is attempted before VMXON.
Keir Fraser [Fri, 25 Apr 2008 12:38:22 +0000 (13:38 +0100)]
Intel VPID: Do not crash if INVVPID is attempted before VMXON.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoshadow: Fix TLB flushing in the second pass of sh_prealloc() in the
Keir Fraser [Fri, 25 Apr 2008 12:27:19 +0000 (13:27 +0100)]
shadow: Fix TLB flushing in the second pass of sh_prealloc() in the
case where multiple vcpus use the same pagetables.

Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com>
17 years agovmx: Fix address of EPT identity-map pagetable that is passed from the
Keir Fraser [Thu, 24 Apr 2008 13:33:42 +0000 (14:33 +0100)]
vmx: Fix address of EPT identity-map pagetable that is passed from the
domain builder down to the hypervisor.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoioemu: Save PCI device INTx line states.
Keir Fraser [Thu, 24 Apr 2008 09:14:43 +0000 (10:14 +0100)]
ioemu: Save PCI device INTx line states.

Otherwise, ioemu can be out of sync with the hypervisor after
restoring guest state, if INTx lines were asserted when the state was
saved. This prevents ioemu from setting the line to zero in Xen
(because it thinks the line is already zero). This can allow th eguest
to enter an endless IRQ loop and hang.

Signed-off-by: Kazuhiro Suzuki <kaz@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoia64: fix domain builder
Keir Fraser [Thu, 24 Apr 2008 09:01:27 +0000 (10:01 +0100)]
ia64: fix domain builder

Windows on ia64 can't boot since cset 17397:61a3e041ea12.
The memory for video RAM must be added as the x86 does.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoxencomm: Fix a trivial warning.
Keir Fraser [Thu, 24 Apr 2008 09:01:11 +0000 (10:01 +0100)]
xencomm: Fix a trivial warning.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
17 years agoxenbaked: Fix access to trace buffer after xentrace changes
Keir Fraser [Thu, 24 Apr 2008 08:59:57 +0000 (09:59 +0100)]
xenbaked: Fix access to trace buffer after xentrace changes

Signed-off-by: Naoki Nishiguchi <nisiguti@jp.fujitsu.com>
17 years agotrace: Notify dom0 from tasklet context.
Keir Fraser [Thu, 24 Apr 2008 08:58:29 +0000 (09:58 +0100)]
trace: Notify dom0 from tasklet context.

Avoids deadlocks by avoiding calling into scheduler recursively
(__trace_var() is sometimes called with scheduler locks held).

Signed-off-by: Naoki Nishiguchi <nisiguti@jp.fujitsu.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoAMD IOV: Fix dom0 initialisation.
Keir Fraser [Wed, 23 Apr 2008 15:58:44 +0000 (16:58 +0100)]
AMD IOV: Fix dom0 initialisation.
Signed-off-by: Wei Wang <wei.wang2@amd.com>
17 years agoblktap: Automatically start tapdisk-ioemu on demand
Keir Fraser [Wed, 23 Apr 2008 15:57:23 +0000 (16:57 +0100)]
blktap: Automatically start tapdisk-ioemu on demand

When a domain wants to use a tap:ioemu disk but has no device model,
start a tapdisk-ioemu instance as provider. Also, move the creation
and removal of communication pipes to xend so that qemu-dm doesn't
need the unwanted SIGHUP handler anymore.

Signed-off-by: Kevin Wolf <kwolf@suse.de>
17 years agodocs: Update xencons- Linux boot parameter to reflect xvc0 is default.
Keir Fraser [Wed, 23 Apr 2008 16:01:43 +0000 (17:01 +0100)]
docs: Update xencons- Linux boot parameter to reflect xvc0 is default.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agodocs: Update for Xen boot parameter changes.
Keir Fraser [Wed, 23 Apr 2008 13:22:20 +0000 (14:22 +0100)]
docs: Update for Xen boot parameter changes.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoDrop characters if an asynchronous serial tx buffer fills up.
Keir Fraser [Wed, 23 Apr 2008 13:17:35 +0000 (14:17 +0100)]
Drop characters if an asynchronous serial tx buffer fills up.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agoNew boot parameter 'serial_tx_buffer=<size>' to change serial
Keir Fraser [Wed, 23 Apr 2008 13:06:51 +0000 (14:06 +0100)]
New boot parameter 'serial_tx_buffer=<size>' to change serial
transmit buffer size from default of 16kB.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
17 years agovt-d: Reduce printk() output to a more sensible level.
Keir Fraser [Wed, 23 Apr 2008 12:51:55 +0000 (13:51 +0100)]
vt-d: Reduce printk() output to a more sensible level.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>